function loadImg(url) {
  return new Promsie((resolve, reject) => {
    let img = new Image();
    img.onload = () => {
      resolve(img);
    };
    img.onerror = () => {
      reject(new Error("Could not load image at" + url));
    };
    img.src = url;
  });
}
